package pri.damai.xiaowu.auth.security.handle;

import pri.damai.xiaowu.auth.utils.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Component;
import pri.damai.xiaowu.common.core.vo.ResultVO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 登出成功处理器
 * @Desc
 * @Author DaMai
 * @Date 2021/10/18 10:31
 * 但行好事，莫问前程。
 */
@Slf4j
@Component
public class RuiRuanLogoutSuccessHandler implements LogoutSuccessHandler {

    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
        HttpUtil.respJson(response, ResultVO.success());
    }
}
